package com.example.demo.service.impl

import com.example.demo.model.dao.AppUserDAO
import com.example.demo.model.entity.AppUser
import com.example.demo.service.UserService
import io.swagger.v3.oas.annotations.servers.Server
import jakarta.annotation.Resource
import org.springframework.stereotype.Service

@Service
class UserServiceImpl : UserService{
    @Resource
    lateinit var appUserDAO: AppUserDAO

    /**
     * 查询所有用户
     */
    override fun findUsers(): AppUser? {
        return appUserDAO.findUsers()
    }

    /**
     * 通过id查询用户
     */
    override fun findUserById(userId: Int): AppUser? {
        return appUserDAO.findByUserId(userId)
    }
}